package com.itheima.enums;

/**
 * 枚举类
 */
public enum MsgCode {
    //成功
    SUCCESS(0, "SUCCESS", true),
    FAIL(20000,"用户名或密码错误", false),
    PARAM_MISSING(1001, "param is missing...", false),
    // 失败
    ERROR_LOGIN(1002,"token失效, 请您重新登录!",false),
    TOKEN_CHANGE(1003,"token has been changed...",false),
    TOKEN_NULL(1004,"token is null...",false),
    LOGIN_FAIL(0,"LOGINING FAIL...",false),

    ERROR_USER_NAME (5500,"未找到用户",false),
    // 注测失败
    REGISTER_ERR(3000,"REGISTER FAIL",false),
    EXCEPTION(-1, "exception", false);


    private int code;
    private String msg;
    private boolean success;


    MsgCode(int code, String msg, boolean success) {
        this.code = code;
        this.msg = msg;
        this.success = success;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean getSuccess() {
        return success;
    }

    public void setChinessMsg(boolean success) {
        this.success = success;
    }
}
